# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-jaraco.vcs
pkgver=2.4.0
pkgrel=0
pkgdesc="Classes for inspecting and working with repositories in the Mercurial and Git version control systems"
url="https://github.com/jaraco/jaraco.vcs"
arch="noarch"
license="MIT"
depends="py3-dateutil py3-jaraco.classes py3-jaraco.versioning py3-more-itertools py3-packaging py3-tempora"
makedepends="py3-gpep517 py3-installer py3-setuptools_scm py3-wheel"
checkdepends="py3-jaraco.path py3-pytest py3-pytest-home"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/jaraco/jaraco.vcs/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/jaraco.vcs-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest --ignore jaraco/vcs/__init__.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
a249c1cbf3835dce30bd73009e3e671214c4c03040fbd1cdfa74f278caa68c0637fe2db94e30e431b470e2c37a259758b03fec195bed6bf9c3f6ede9091eccaf  py3-jaraco.vcs-2.4.0.tar.gz
"
